export const useWarehouseStore = defineStore('warehouse', () => {
    const cacheName = 'warehouse'
    const id = ref(JSON.parse(localStorage.getItem(cacheName) || '{}').id)
    const name = ref(JSON.parse(localStorage.getItem(cacheName) || '{}').name)

    const setInfo = (warehouse) => {
        id.value = warehouse.id
        name.value = warehouse.name
        localStorage.setItem(cacheName, JSON.stringify(warehouse))
    }
    return { id, name, setInfo }
}, {
    persist: {
        enabled: true
    }
})
